﻿Imports Mysoft.Map.Data

Partial Class Pzgl_KjFzHsExport
    Inherits Mysoft.Map.Application.Security.AppPage

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        If Not IsPostBack Then

            '绑定财务账套
            BindCwzt()

        End If

        txtRight.Text = MySoft.Map.Application.Security.User.CheckUserRight(Session("UserGUID"), "02010706", "05")
    End Sub

    '绑定财务账套
    Sub BindCwzt()
        Dim strSQL, strCwztGUID As String
        Dim dtCwzt As DataTable
        Dim i, count As Integer
        Dim strApp As String = ""
        If Not Request.QueryString("Application") Is Nothing Then
            strApp = Request.QueryString("Application").ToString.ToUpper
        End If
        Dim MyGeneral As New Mysoft.Map.Utility.General
        strCwztGUID = MyGeneral.GetCurrArg("DefaultCwzt_CB")
        strSQL = "SELECT CwztGuid,CwztName FROM p_CwjkCwzt WHERE Application='" & strApp & "' AND BUGUID='" & Session("BUGUID") & "'ORDER BY CwztName"
        dtCwzt = MyDB.GetDataTable(strSQL)
        count = dtCwzt.Rows.Count
        If count > 0 Then
            For i = 0 To count - 1
                Dim item As New ListItem
                item.Text = dtCwzt.Rows(i).Item("CwztName").ToString
                item.Value = dtCwzt.Rows(i).Item("CwztGuid").ToString
                If item.Value.ToUpper() = strCwztGUID.ToUpper() Then
                    item.Selected = True
                End If

                Me.ddlCwzt.Items.Add(item)
            Next
        End If
    End Sub

End Class
